﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Objects
{
    [Table("Comments")]
    public class Comment
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int CommentId { get; set; }

        //[InverseProperty("Id")]
        //[ForeignKey("FK_ROUTEID_COMMENTS")]
        //public int RouteId { get; set; }

        public string Content { get; set; }

        public int Rate { get; set; }

        public bool IsPositive { get; set; }

        public virtual UserProfile Author { get; set; }

        [InverseProperty("Id")]
        [ForeignKey("FK_ROUTEID_COMMENTS")]
        public virtual Route Route { get; set; }


        [InverseProperty("UserId")]
        [ForeignKey("FK_AUTHORID_COMMENTS")]
        public virtual UserProfile UserProfile { get; set; }

    }
}
